// myPlugin.js
export default function split() {
  return {
    name: 'my-plugin',
    config(config: any, { command }: { command: any }) {
      // 只在 build 命令时应用
      if (command === 'build') {
        return {
          build: {
            rollupOptions: {
              output: {
                manualChunks(id: any) {
                  if (id.includes('node_modules')) {
                    return 'vendor';
                  }
                }
              }
            }
          }
        };
      }
    }
  };
}